<template>
    <Modal okText="确定" cancelText="取消" :open="open" title="文本内容" @cancel="handleCancel" @ok="handleOk">
        <Editor :onlyEmojis="true" ref="textRef" />
    </Modal>
</template>

<script setup lang="ts">
import {ref} from "vue";
import Editor from "../../Editor/Editor.vue";
import {Modal} from "ant-design-vue";
const textRef = ref<any>("");
const open = ref(false);
const handleOpen = () => {
    open.value = true;
};
const handleCancel = () => {
    open.value = false;
};
const handleOk = () => {
    const msg = textRef.value?.getMessage();
    open.value = false;
    return msg;
};

defineExpose({
    show: handleOpen,
    submit: handleOk,
});
</script>
